from .models import AreaInfo, City
from .data import arealists, citylists

# 插入地区数据
arealist = arealists
for item in arealist:
    area = AreaInfo()
    area.area_name, area.area_code = item
    area.save()
print(AreaInfo.objects.all())

# 插入省市区联动信息
citylist = citylists
for item in citylist:
    city = City()
    city.area_code, city.area_name, city.area_parent = item
    city.save()
print(City.objects.all())
